import { createRouter, createWebHistory } from 'vue-router';
import Index from '../pages/Index.vue'
const router = createRouter({
    history: createWebHistory(),
    routes: [{
        path: '/',
        redirect: '/index',
        component: Index,
        meta: { title: '首页' },
        children: [{
            path: '/index',
            name: 'index',
            component: () =>
                import ('../pages/subpage/index.vue'),
            meta: { title: '首页' }
        }, {
            path: '/category',
            name: 'category',
            component: () =>
                import ('../pages/subpage/category.vue'),
            meta: { title: '分类管理' }
        }, {
            path: '/user',
            name: 'user',
            component: () =>
                import ('../pages/subpage/user.vue'),
            meta: { title: '个人中心' }
        }, {
            path: '/goods',
            name: 'goods',
            component: () =>
                import ('../pages/subpage/goods.vue'),
            meta: { title: '商品管理' }
        }, ]
    }, {
        path: '/login',
        name: 'login',
        component: () =>
            import ('../pages/Login.vue'),
        meta: { title: '登录' }
    }, ]
})
export default router;